<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>查看明细</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
    <script type="text/javascript">
        var grid = null;
        $(function () {
        	var batNo = $("#batNo").val();
            $("#ligergrid1").ligerGrid({
                url: '<%=path%>/mcr/mcrWriteOffConfirmDetail/checkDetailsList.do?batNo='+batNo,
                method : 'get',
                columns: [
                    { display: '合同号', name: 'pactNo', width: 120, enabledSort:true },
                    { display: '客户姓名', name: 'cstNm', width: 120, enabledSort:true },
                    { display: '实收时间', name: 'repayDate', minWidth: 100, render:renderDate, align: 'center', enabledSort:true},
                    { display: '实收类型', name: 'repayType', width: 150, enabledSort:true,
                        render:function(rowData){
                            if(rowData.repayType=="1"){
                            	return "待确认";
                            }else if(rowData.repayType=="2"){
                            	return "合同生成";
                            }else if(rowData.repayType=="3"){
                            	return "放款中";
                            }else if(rowData.repayType=="4"){
                            	return "已放款";
                            }else if(rowData.repayType=="5"){
                            	return "放款失败";
                            }else if(rowData.repayType=="6"){
                            	return "正常结清";
                            }else if(rowData.repayType=="7"){
                            	return "提前结清";
                            }else if(rowData.repayType=="8"){
                            	return "强制结清";
                            } else{
                            	return "作废";
                            }
                        }
                    },
                    { display: '还款期次', name: 'perdNo', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '实收金额(元)', name: 'repayAmt', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '实收本金(元)', name: 'repayPrincipal', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '实收利息(元)', name: 'repayInterest', minWidth: 100, align: 'center', enabledSort:true},
                    { display: '实收罚息(元)', name: 'repayPenaltyInterest', minWidth: 100, align: 'center', enabledSort:true},
                ],
                pageSize:10,
                root:'rows',
                record:'total',
                hideLoadButton : true,
                width: '100%',
                height:380,
                heightDiff:-2,
                //checkbox:true,
                rownumbers:true
            });
            grid = liger.get("ligergrid1");
            $("#searchBar").ligerForm();
            $("#searchBtn").click(function(event) {
                var form = new liger.get("searchBar");
                var data = form.getData();
                console.log(data);
                for (name in data){
                    grid.setParm(name,data[name]);
                };
                grid.reload();
            });
            $("#clearBtn").click(function(event) {
                clearLigerForm("searchBar");
            });
        });
        //格式化时间
        function renderDate(rowdata, index, value){
            var dateStr = "";
            if(null != value){
                var date = new Date(value);
                dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
            }
            return dateStr;
        }
    </script>
</head>

<body class="iframeBody">
<input name="batNo" id="batNo" type="hidden" value="${batNo}">
<div id="ligergrid1" class="sq-grid"></div>
</body>
</html>
